//通用查询参数
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface comQueryParams {
  brand_id?: number | string;
  id_list?: (string | number)[];
}

export interface comPageQueryParams {
  page?: number;
  pageSize?: number;
  page_size?: number;
  id?: number;
}

export interface serviceEnableStatusModel {
  id: number;
  enable: number;
}

export interface pushConfigModel {
  address?: string | undefined;
  comment?: string | undefined;
}

export interface pushconfig {
  id?: number;
  address?: string | undefined;
  comment?: string | undefined;
}

export interface selectdatalog {
  device_name?: string;
  data_type?: string;
  keys?: string;
  start_time?: string;
  end_time?: string;
}

export interface SetdefaultdriveModel {
  device_type_id: number | string;
  drive_id: number | string;
}

//驱动列表参数
export interface drivePageParams extends comPageQueryParams {
  device_type_id?: number | String;
  name?: number | String;
}

export interface comPageParams extends comPageQueryParams {
  name: number | String;
  code: number | String;
  device_type_id: number | String;
}
// 协议
export interface IotConfigModel {
  id?: number;
  name: string;
  type: string;
  host?: string;
  port?: number;
  config?: string;
}
//操作驱动
export interface DriveModel {
  id?: number;
  drive_package?: string;
  device_type_id?: number;
}

// 品牌商
export interface BrandModel {
  id?: number;
  code?: string;
  name: string;
  contact_person?: string;
  contact_info?: string;
  address?: string;
}

// 型号
export interface DeviceTypeModel {
  id?: number;
  code?: string;
  name: string;
  brand_id?: number;
  default_drive_id?: number;
}
//
export interface ModeList {
  items: [];
}
export interface ServiceModel {
  id?: string;
  host: string;
  port: number;
  token: string;
  config: Object;
}
// 添加物模型组：
export interface ModelGroup {
  code: string;
  group_name: string;
  device_mode_id: string;
}
// 获取物模型组:
export interface getModelGroup extends comPageQueryParams {
  device_mode_id: string;
}

// 删除物模型组:
export interface DelModelGroup {
  id_list: Number[];
}

// 物模型属性:
export interface ModelAttr {
  name: string;
  tag: string;
  data_type: string;
  read_write_mod: string;
  rule: string;
  describe: string;
}

// 新增物模型属性:
export interface AddModelAttr extends ModelAttr {
  group_id: string;
}

//  编辑物模型属性:
export interface ModfiyModelAttr extends ModelAttr {
  id: string;
}

// 查询物模型属性
export interface QueryModelAttr extends comPageQueryParams {
  group_id: string;
}

// 子设备
export interface Equipment {
  name: string;
  device_mode_id: string;
  brand_id: string;
  device_type_id: string;
  host: string;
  port: string;
  username: string;
  password: string;
  address: string;
  tag_list: string;
}

// 新增设备
export interface AddEquipment extends Equipment {
  code: string;
}

// 修改设备
export interface ModifyEquipment extends Equipment {
  id: string;
}

// 查询设备
export interface GetEquipment extends comPageQueryParams {
  name?: string;
  code?: string;
  tag_name?: string;
}
export type ServicePageParams = BasicPageParams & ServiceModel;
export type ServicePageListGetResultModel = BasicFetchResult<ServiceModel>;
